#include <iostream>
#include <vector>
#include "Graph.h"
#include <stdlib.h>
#include <time.h>


int main()
{
  srand((int)time(NULL));
  Graph<int> graph;
  graph.Setmode(2);
  for ( int i = 0; i < 2000; i++ )
    for ( int j = 0; j < 2000; j++ )
      graph.Add_Edge(i,j,rand()%100000);

  /*for ( int i = 0; i < 1000; i++ )
    graph.Add_Edge(i,i+1,rand()%100000);
  for ( int j = 0; j < 99000; j++ )
  graph.Add_Edge(rand()%999,rand()%999,rand()%100000);*/

  /*graph.Add_Edge(0,1,1);
  graph.Add_Edge(1,2,8);
  graph.Add_Edge(2,3,99);
  graph.Add_Edge(3,0,6);
  graph.Add_Edge(2,0,2);
  graph.Add_Edge(1,3,5);*/

  clock_t start, finish;
  double duration;
  graph.f();
  
  start = clock();
  graph.Bellman_Ford(0);
  finish = clock();
  duration = (double)(finish - start) / CLOCKS_PER_SEC;
  std::cout << "所耗时间为：" << duration << std::endl;

  start = clock();
  graph.Bellman_Ford(500);
  finish = clock();
  duration = (double)(finish - start) / CLOCKS_PER_SEC;
  std::cout << "所耗时间为：" << duration << std::endl;

  start = clock();
  graph.Bellman_Ford(950);
  finish = clock();
  duration = (double)(finish - start) / CLOCKS_PER_SEC;
  std::cout << "所耗时间为：" << duration << std::endl;

  return 0;
}
